package com.recipedb.recipedb.entity;

import java.io.Serializable;
import java.util.Objects;

public class LikesId implements Serializable {

    private Long userId;
    private Long recipeId;

    public LikesId() {}
    public LikesId(Long userId, Long recipeId) {
        this.userId = userId;
        this.recipeId = recipeId;
    }

    // equals & hashCode
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LikesId)) return false;
        LikesId that = (LikesId) o;
        return Objects.equals(userId, that.userId) &&
                Objects.equals(recipeId, that.recipeId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId, recipeId);
    }
}